package org.fly.bean.query;


import org.fly.utils.PageUtils;

/**
 * @author  fly
 */
public class PageQuery {
    private int page;//第几页
    private int size;//一页多少条数据
    private int offset;//开始第几条数据

    public PageQuery(){}
    public PageQuery(int page, int size){
        this.page =  page;
        this.size = size;
        this.offset = PageUtils.getOffset(size,page);
    }
    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getOffset() {
        return PageUtils.getOffset(size,page);
    }

    public void setOffset(int offset) {
        this.offset = offset;
    }
}
